#!perl -T

use strict;
use warnings;
use Date::Simple qw/date today ymd/;

use Test::More;

BEGIN {
	use_ok( 'NaturalDateGuesser' );
}

my $parser = NaturalDateGuesser->new();

my $today = today();

my $list = [
[ "23rd June 2006", ymd(2006, 6, 23) ],
[ "23 Jan 2006", ymd(2006, 1, 23) ],
[ "23-June-2004", ymd(2004,6,23) ],
[ "05-Sep-2020", ymd(2020, 9, 5) ],
[ "05/Sep/2020", ymd(2020, 9, 5) ],
[ "05\\Sep\\2020", ymd(2020, 9, 5) ],
[ "5th October, 2005", ymd(2005, 10, 5) ]
];

plan tests => scalar @$list;

foreach my $item (@$list)
{
	my ($string, $expected) = @$item;
	is($parser->parseDate($string), $expected, 
		"Parse $string");
}

